﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;

public partial class WebPrint_PrintZs : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            InitDate();
        }
    }
    //初始化数据
    void InitDate()
    {
        using (DataClassesDataContext dc = new DataClassesDataContext())
        {
            var pros = from r in dc.css_dwxx
                       where r.dwbh == Convert.ToInt32(Request.QueryString["ZID"])
                       select new
                       {
                           zh = r.zh,
                           jgbh = r.fzjg,
                           fzrq = r.fzrq,
                           dwmc = r.dwmc,
                           fwdz = r.fwdz,
                           fzr = r.fzr
                       };
            foreach (var pro in pros)
            {
                zh.Value = pro.zh;
                if (pro.jgbh == "0001")
                {
                    jg.Value = "杭州市民政局";
                }
                else if (pro.jgbh == "0002")
                {
                    jg.Value = "杭州市贸易局";
                }
                dwmc.Value = pro.dwmc;
                fwdz.Value = pro.fwdz;
                fzr.Value = pro.fzr;
            }
        }
    }
}